
<?php 
if($mode== "ADD"){

	?>
	
	
<script
	type="text/javascript"
	src="<?= base_url();?>third_party/fancy_box/lib/jquery-1.8.0.min.js"></script>
<link
	rel="stylesheet" type="text/css" media="all"
	href="<?= base_url();?>third_party/jsdatepick-calendar/jsDatePick_ltr.min.css" />
<script
	type="text/javascript"
	src="<?= base_url();?>third_party/jsdatepick-calendar/jsDatePick.min.1.3.js"></script>
<script type="text/javascript">
	window.onload = function(){
		new JsDatePick({
			useMode:2,
			target:"startDate",
			dateFormat:"%d-%m-%Y"			
		});
		new JsDatePick({
			useMode:2,
			target:"endDate",
			dateFormat:"%d-%m-%Y"			
		});
	};
</script>
<div class="heading-buttons">
	<h3 class="glyphicons picture">
		<i></i> Banner Management
	</h3>



</div>
<div class="separator"></div>




<div class="widget widget-2 widget-body-white finances_summary">
	<div class="widget-head">
		<h4 class="heading glyphicons picture">
			<i></i> Add Banner
		</h4>
	</div>
	<div class="widget-body">
		<div class="row-fluid">

			<form name="banner" method="POST" enctype="multipart/form-data"
				action="<?= base_url(); ?>banner/admin/admin_banner/upload_banner">

				<fieldset>
					<table class="table table-condensed">
						<tbody>
							<tr>
								<td colspan="3" class="table-no-broder"><?php
								$this->session->flashdata('message'); {
									$msg = $this->session->flashdata('message');
									echo '<font color="red">' . $msg . '</font>';
								}
								?>
								</td>
							</tr>
							<tr>


								<td class="left"><label>Select Size</label>
								</td>

								<td><select name="banner_size" style="width: 150px">
										<option value="" selected="selected">---Select Size---</option>

										<?php foreach ($pickup['banner_size'] as $banner_size): ?>
										<option value="<?= $banner_size->description; ?>">
											<?= $banner_size->description; ?>
										</option>
										<?php endforeach; ?>
								</select> <input style="border: none" type="file"
									name="userfile" value="Browse" />
								</td>
								<td>IMAGE SIZE: width X height<br>
								Front slider image: 724 X 200
								</td>
								
								<td class="table-no-broder"></td>


							</tr>
<tr>

								<td class="left"><label>Banner Title</label></td>
								<td>
								<?php echo form_error('banner_title'); ?>
								<input name="banner_title" type="text" size="40" 
								value="<?php echo set_value('banner_title');?>">
								</td>
								<td></td>
							</tr>


							<tr>


								<td class="left"><label> Link</label></td>
								<td><input name="link" type="text" size="40" value="#" /></td>
								<td></td>
							</tr>
							<tr>
								<td class="left"><label> Starting Date </label></td>
								<td class="input-append">
								
								<input class="input-small" type="text" name="start_date" id="dateRangeFrom"/>
								<span class="add-on glyphicons calendar"><i></i></span>
								</td>

							</tr>
							<tr>
								<td class="left"><label>End Date </label></td>
								<td class="input-append"><input type="text" name="end_date" id="dateRangeTo" class="input-small"/>
								<span class="add-on glyphicons calendar"><i></i></span>
								</td>
								
							</tr>
							
							<!-- <tr>
							<td>
							<div class="input-append">
				<input type="text" name="from" id="dateRangeFrom" class="input-mini" value="08/05/13" style="width: 53px;" />
				<span class="add-on glyphicons calendar"><i></i></span>
			</div>
		</div>
		<div>
			<label>To:</label>
			<div class="input-append">
				<input type="text" name="to" id="dateRangeTo" class="input-mini" value="08/18/13" style="width: 53px;" />
				<span class="add-on glyphicons calendar"><i></i></span>
			</div>
							</td>
							</tr> -->
							<tr>
								<td class="left"><label>Max impressions </label></td>
								<td>
								<?php echo form_error('impression'); ?>
								<input id="impression" type="text" name="impression" 
								value="<?php echo set_value('impression');?>">
								<span
									id="label">(0= Unlimited)</span></td>

							</tr>
							<tr>
								<td class="left"><label>Max clicks </label></td>
								<td>
								<?php echo form_error('click'); ?>
								<input id="click" type="text" name="click" 
								value="<?php echo set_value('click');?>">
								<span
									id="label">(0= Unlimited)</span></td>

							</tr>
							<tr>
							<td class="left"><label>
							Show
							</label></td>
							<td><select name="show" style="width: 150px">
							<option value="" selected="selected" >----Select Page----</option>
							<option value="0">All</option>
							<option value="1">Index Page</option>
							<option value="2">Inner Page</option>
							<option value="3">Category </opyion>
							<option value="4">Slider</option>
							</select>
							<span
									id="label">(Assign Page)</span>
							</td>
							</tr>
							
							<tr>
							<td class="left"><label>
							Select Category
							</label></td>
							<td><select name="category" style="width: 220px">
							<option value="" selected="selected" >------Select Category-----</option>
							<?php foreach($parent as $parent):?>
							<option value="<?= $parent->id;?>"><?= $parent->name;?></option>
							<?php endforeach;?>
							
							</select>
							<span
									id="label">(Assign Category)</span>
							</td>
							</tr>
							<!-- 
							<tr>
								<td class="left"><label>Show InnerPage</label></td>
								<td><input type="checkbox" name="show" value="1" /></td>

							</tr>
							<tr>
								<td class="left"><label>Show IndexPage</label></td>
								<td><input type="checkbox" name="show" value="2" /></td>
							</tr>
 -->



							<tr>

								<td></td>
								<td><label> <input type="submit" class="btn btn-inverse" name="upload"
										value="Add Now" <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');"/>
								</label>
								</td>
								<td></td>
							</tr>
					
					</table>
				</fieldset>
			</form>
		</div>
	</div>
</div>






<?php }?>
<?php 
if($mode=="EDIT"){
	?>










<link rel="stylesheet" href="<?= base_url();?>assets/admin/css/thumbnailviewer.css" media="screen" />
<script src="<?= base_url();?>assets/admin/js/thumbnailviewer.js"></script>	
	
<script
	type="text/javascript"
	src="<?= base_url();?>third_party/fancy_box/lib/jquery-1.8.0.min.js"></script>
<link
	rel="stylesheet" type="text/css" media="all"
	href="<?= base_url();?>third_party/jsdatepick-calendar/jsDatePick_ltr.min.css" />
<script
	type="text/javascript"
	src="<?= base_url();?>third_party/jsdatepick-calendar/jsDatePick.min.1.3.js"></script>
<script type="text/javascript">
	window.onload = function(){
		new JsDatePick({
			useMode:2,
			target:"startDate",
			dateFormat:"%d-%m-%Y"			
		});
		new JsDatePick({
			useMode:2,
			target:"endDate",
			dateFormat:"%d-%m-%Y"			
		});
	};
</script>
<div class="heading-buttons">
	<h3 class="glyphicons picture">
		<i></i> Banner Management
	</h3>



</div>
<div class="separator"></div>




<div class="widget widget-2 widget-body-white finances_summary">
	<div class="widget-head">
		<h4 class="heading glyphicons picture">
			<i></i> Update Banner
		</h4>
		<span class="pull-right"> <a
			href="<?= base_url();?>banner/admin/admin_banner/banner_list"> <span
				class="btn btn-inverse margin-right">Go to Banner List</span>
		</a>
		</span>
		
	</div>
	<div class="widget-body">
		<div class="row-fluid">

			<form name="banner" method="POST" enctype="multipart/form-data"
				action="<?= base_url(); ?>banner/admin/admin_banner/update_banner">

				<fieldset>
					<table class="table table-condensed">
						<tbody>
							<tr>
								<td colspan="3" class="table-no-broder"><?php
								$this->session->flashdata('message'); {
									$msg = $this->session->flashdata('message');
									echo '<font color="red">' . $msg . '</font>';
								}
								?>
								</td>
							</tr>
							<tr>


								<td class="left"><label>Select Size</label>
								<td>
								
								<select name="banner_size" style="width: 150px">
										<option value="" selected="selected">---Select Size---</option>

										<?php foreach($banner_size as $banner_size):?>
										<option value="<?= $banner_size->description; ?>"
										<?php if($banner_size->description == $banners['details']->size){echo "selected=selected";}?>>
											<?= $banner_size->description; ?>
										</option>
										<?php endforeach; ?>
								</select>
								
								 <input style="border: none" type="file"
									name="userfile" value="<?= $banners['details']->file;?>">
									</td>
									
																<td>
							<img height="50" width="80"
								src="<?= base_url();?>assets/images/banner/<?= $banners['details']->file;?>" alt="Image 001" />
							
														</td>
									
													<td class="table-no-broder"></td>


							</tr>

							<tr>

								<td class="left"><label>Banner Title</label></td>
								<td><input name="banner_title" type="text"
									value="<?= $banners['details']->title;?>" size="40" /></td>
								<td></td>
							</tr>


							<tr>


								<td class="left"><label> Link</label></td>
								<td><input name="link" type="text" size="40"
									value="<?= $banners['details']->link;?>" /></td>
								<td></td>
							</tr>
							<tr>
								<td class="left"><label> Starting Date </label></td>
								<td><input id="startDate" type="text" name="start_date"
									value="<?= $banners['details']->date_start;?>" /></td>

							</tr>
							<tr>
								<td class="left"><label>End Date </label></td>
								<td><input id="endDate" type="text" name="end_date"
									value="<?= $banners['details']->date_end;?>" /></td>

							</tr>
							<tr>
								<td class="left"><label>Max impressions </label></td>
								<td><input id="impression" type="text" name="impression"
									value="<?= $banners['details']->max_impressions;?>" /><span
									id="label">(0= Unlimited)</span></td>

							</tr>
							<tr>
								<td class="left"><label>Max clicks </label></td>
								<td><input id="click" type="text" name="click"
									value="<?= $banners['details']->max_clicks;?>" /><span
									id="label">(0= Unlimited)</span></td>

							</tr>
<tr>
							<td class="left"><label>
							Show
							</label></td>
							<td>
							<select name="show">
									
									<option value="0"
									<?php if ($banners['details']->shows=="0") echo 'selected="selected"';?>>All</option>

									<option value="1"
									<?php if ($banners['details']->shows=="1") echo 'selected="selected"';?>>Index Page</option>
									<option value="2"
									<?php if ($banners['details']->shows=="2") echo 'selected="selected"';?>>Inner Page</option>

									<option value="3"
									<?php if ($banners['details']->shows=="3") echo 'selected="selected"';?>>Category</option>
							
							
							</select>
							<span
									id="label">(Assign Page)</span>
							</td>
							</tr>
							<tr>
							<td class="left"><label>
							Category
							</label></td>
							<td>
							<select name="category">
							<option>-- Select Category --</option>
										<?php foreach($parent as $parent):?>
										<option value="<?= $parent->id;?>"
										<?php if($parent->id == $banners['details']->category){echo "selected=selected";}?>>
											<?= $parent->name;?>
										</option>
										<?php endforeach;?>
									</select><span
									id="label">(Assign Category)</span>
									</td></tr>
							<!-- 
							<tr>


								<td class="left"><label>Show InnerPage</label></td>
								<td><input type="checkbox" name="show" value="1"
								<?php if ($banners['details']->show == '1')


									echo 'checked=checked'?> /></td>

							</tr>
							<tr>
								<td class="left"><label>Show IndexPage</label></td>
								<td><input type="checkbox" name="show" value="2"
								<?php if($banners['details']->show == '2')

									echo 'checked=checked'?> /></td>
							</tr>

 -->


							<tr>

								<td></td>
								<td><label> 
								
								<input type="hidden" name="id" value="<?= $id;?>"> 
								
								<input
										type="submit" class="btn btn-info" name="upload" value="Update" <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');" />
								</label>
								</td>
								<td></td>
							</tr>
					
					</table>
				</fieldset>
			</form>
		</div>
	</div>
</div>
<?php }?>
